export default {
    state: {
        isCollapse: false,
        breadcrumbList: [
            {
                path: "/",
                name: "home",
                label: "首页",
                icon: "s-home",
                url: "Home/Home",
            },
        ]
    },
    mutations: {
        modifiCollapse(state) {
            state.isCollapse = !state.isCollapse
        },
        modifyBreadcrumbData(state, item) {
            if (item.name !== 'home') {
                const res = state.breadcrumbList.findIndex(val => val.name === item.name)
                // 如果不存在item，就放把当前的item进去
                if (res === -1) state.breadcrumbList.push(item)
            }
        }
    }
}

